@echo off
setlocal enabledelayedexpansion

:: 设置源目录
set "source_base=D:\py-workspace\ok-xt\dist\bundle"

:: 设置要复制的文件夹名
set "folders=assets_xt _internal"
@REM set "folders=auto_fight assets_ys _internal"

:: 设置目标基础目录列表
set "target_bases=D:\py-workspace\ok-xt-release\ok-xt"

:: 循环遍历每个目标基础目录
for %%b in (%target_bases%) do (
    set "target_base=%%b"

    set "source_exe=%source_base%\ok-xt.exe"
    :: 复制exe文件，如果有同名文件则覆盖
    xcopy /E /Y "!source_exe!" "!target_base!"
    echo Copied !source_exe! to !target_base!
    :: 循环遍历每个文件夹
    for %%f in (%folders%) do (
        set "source=%source_base%\%%f"
        set "target=!target_base!\%%f"

        :: 如果目标目录不存在，则创建它
        if not exist "!target!" mkdir "!target!"

        :: 复制文件，如果有同名文件则覆盖
        xcopy /E /Y "!source!\*" "!target!"

        echo Copied !source! to !target!
    )
)

echo All files have been copied.
@REM pause